package cn.icanci.loopstack.ddk.web.webapi;

import cn.icanci.loopstack.ddk.admin.biz.service.RegisterService;
import cn.icanci.loopstack.ddk.common.result.R;
import cn.icanci.loopstack.ddk.web.form.PublishResourceForm;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 对外部系统提供服务
 * - 对notice的通知功能
 * 
 * @author icanci
 * @since 1.0 Created in 2023/01/12 23:36
 */
@RestController
@RequestMapping("/ddk/webapi")
public class DdkWebApiFacade {
    @Resource
    private RegisterService registerService;

    @PostMapping("publish")
    public R publishResource(@RequestBody PublishResourceForm publish) {
        registerService.publishResource(publish.getResource(), publish.getValue());
        return R.builderOk().build();
    }

}
